USE [Monitoring]
GO

--|--------------------------------------------------------------------------------
--| [GetEntityAttributeTypeByID] - Insert Procedure Script for EntityAttributeType
--|--------------------------------------------------------------------------------
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id (N'[dbo].[GetEntityAttributeTypeByID]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) 
  DROP PROCEDURE [dbo].[GetEntityAttributeTypeByID]
GO

/*CREATE PROCEDURE [dbo].[GetEntityAttributeTypeByID]
(
	@ID int
)
AS
	SET NOCOUNT ON

	SELECT
		[ID],
		[EntityTypeID],
		[Name]
	FROM 
EntityAttributeType
	WHERE
		[ID] = @ID
	
GO
*/

--|--------------------------------------------------------------------------------
--| [InsertEntityAttributeType] - Insert Procedure Script for EntityAttributeType
--|--------------------------------------------------------------------------------
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id (N'[dbo].[InsertEntityAttributeType]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) 
  DROP PROCEDURE [dbo].[InsertEntityAttributeType]
GO

/*CREATE PROCEDURE [dbo].[InsertEntityAttributeType]
(
	@ID int,
	@EntityTypeID int,
	@Name nvarchar(50)
)
AS
	SET NOCOUNT ON

	INSERT INTO [EntityAttributeType]
	(
		[ID],
		[EntityTypeID],
		[Name]
	)
	VALUES
	(
		@ID,
		@EntityTypeID,
		@Name
	)

	RETURN @@Error
GO
*/
--|--------------------------------------------------------------------------------
--| [UpdateEntityAttributeType] - Update Procedure Script for EntityAttributeType
--|--------------------------------------------------------------------------------
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id (N'[dbo].[UpdateEntityAttributeType]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) 
	DROP PROCEDURE [dbo].[UpdateEntityAttributeType]
GO

/*CREATE PROCEDURE [dbo].[UpdateEntityAttributeType]
(
	@ID int,
	@EntityTypeID int,
	@Name nvarchar(50)
)
AS
	SET NOCOUNT ON
	
	UPDATE [EntityAttributeType]
	SET
		[ID] = @ID,
		[EntityTypeID] = @EntityTypeID,
		[Name] = @Name
	WHERE 
		[ID] = @ID

	RETURN @@Error
GO
*/
--|--------------------------------------------------------------------------------
--| [DeleteEntityAttributeType] - Update Procedure Script for EntityAttributeType
--|--------------------------------------------------------------------------------
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id (N'[dbo].[DeleteEntityAttributeType]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) 
	DROP PROCEDURE [dbo].[DeleteEntityAttributeType]
GO

/*CREATE PROCEDURE [dbo].[DeleteEntityAttributeType]
(
	@ID int
)
AS
	SET NOCOUNT ON

	DELETE 
	FROM   [EntityAttributeType]
	WHERE  
		[ID] = @ID

	RETURN @@Error
GO
*/
